$(function () {
    function getUserInfo() {
        request({
            type: 'get',
            url: '/admin/user/info',
            success: function (response) {
                if(response.code === 200){
                    const { nickname, userPic } = response.data
                    $('.user_info span').html(nickname)
                    $('.user_info img').prop('src', userPic)
                    $('.user_center_link img').prop('src', userPic)
                }
            }
        })
    }
    getUserInfo()
})
function logout() {
    window.localStorage.removeItem('bignews_token')
    window.location.href = 'login.html'
}

$('.menu').on('click', '.level01', function () {
    $('.level01.active').removeClass('active')
    $(this).addClass('active')
    if($(this).html().indexOf('文章管理') > -1){
        $('.level02').stop().slideToggle();
        $('.level01 b').toggleClass('rotate0')
    }
})